From 7e3d89c50c3dbacd2b6327f6ee8011eacf08f6fe Mon Sep 17 00:00:00 2001 From: Robert Lipe Date: Sun, 2 Dec 2018 22:45:41 -0600 Subject: [PATCH] For single argument ctors, mark type explicit. --- sort.h | 4 ++-- src/core/file.h | 2 +- src/core/logging.h | 2 +- src/core/xmlstreamwriter.h | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sort.h b/sort.h index 68e610f1f..8bf31b6f0 100644 --- a/sort.h +++ b/sort.h @@ -114,7 +114,7 @@ private: class SortCompWptFunctor { public: - SortCompWptFunctor(SortFilter& obj) : that(&obj) {} + explicit SortCompWptFunctor(SortFilter& obj) : that(&obj) {} int operator()(const queue* a, const queue* b); private: @@ -124,7 +124,7 @@ private: class SortCompRteHdFunctor { public: - SortCompRteHdFunctor(SortFilter& obj) : that(&obj) {} + explicit SortCompRteHdFunctor(SortFilter& obj) : that(&obj) {} int operator()(const queue* a, const queue* b); private: diff --git a/src/core/file.h b/src/core/file.h index 0f16350df..d8357c72e 100644 --- a/src/core/file.h +++ b/src/core/file.h @@ -30,7 +30,7 @@ namespace gpsbabel class File : public QFile { public: - File(const QString& s) : QFile(s) {} + explicit File(const QString& s) : QFile(s) {} /* in the tradition of gbfile we assume WriteOnly or ReadOnly, not ReadWrite */ bool open(OpenMode mode) override { diff --git a/src/core/logging.h b/src/core/logging.h index b8572de99..40e832e1d 100644 --- a/src/core/logging.h +++ b/src/core/logging.h @@ -28,7 +28,7 @@ class Warning { public: - Warning(bool fatal = false) : + explicit Warning(bool fatal = false) : fatal_(fatal) { file_.open(stderr, QIODevice::WriteOnly); fileStream_.setDevice(&file_); diff --git a/src/core/xmlstreamwriter.h b/src/core/xmlstreamwriter.h index 829a421cf..d99618186 100644 --- a/src/core/xmlstreamwriter.h +++ b/src/core/xmlstreamwriter.h @@ -49,8 +49,9 @@ protected: class XmlStreamWriter : public QXmlStreamWriter { public: - XmlStreamWriter(QString* string); - XmlStreamWriter(QFile* f); + explicit XmlStreamWriter(QString* string); + + explicit XmlStreamWriter(QFile* f); void writeStartDocument(void); void writeOptionalAttribute(const QString& qualifiedName, const QString& value); -- 2.30.2